<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>测试</title>
</head>

<body>
    <script type="text/javascript">
        /*function type(target){
                			var template = {
                				"[object Array]": "array",
                				"[object Object]" : "object",
                				"[object Number]" : "number - Object",
                				"[ojbect Boolean]" : 'boolean - object',
                				"[object String]" : 'string - object'
                			}
                			if(target === null){
                				return null;
                			}
                			if(typeof(target) == 'object'){
                				var str = Object.prototype.toString.call(target);
                				return template[str];
                			}else{
                				return typeof(target);
                			}
                		}*/

        Array.prototype.unrepeat = function() {
            var temp = {};
            var arr = [];
            var len = this.length;
            for (var i = 0; i < len; i++) {
                if (!temp[this[i]]) {
                    temp[this[i]] = "a";
                    arr.push(this[i]);
                }
            }
            return arr;
        }

        var arr = [1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 4];
        console.log(arr.unrepeat().toString())
    </script>
</body>

</html>